﻿using System;

using System.Web.UI.WebControls;
using Micronet.OpenWeb.Utils;

namespace Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenPersonality
{
    public partial class ReligionsEdit : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if ("Id".OwQsIsExist())
            {
                ReligionsDv.DefaultMode = DetailsViewMode.Edit;
            }
            else
            {
                ReligionsDv.DefaultMode = DetailsViewMode.Insert;

            }

            ReligionsOds.Deleted += new ObjectDataSourceStatusEventHandler(RiligionsOds_Deleted);
            ReligionsOds.Inserted += new ObjectDataSourceStatusEventHandler(RiligionsOds_Inserted);
            ReligionsOds.Updated += new ObjectDataSourceStatusEventHandler(RiligionsOds_Updated);
        }

        void RiligionsOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("ReligionsAdmin.aspx");
        }

        void RiligionsOds_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("ReligionsAdmin.aspx");

        }

        void RiligionsOds_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("ReligionsAdmin.aspx");

        }
    }
}